<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="<?php echo base_url();?>public/img/favicon.ico" type="image/x-icon">
    <link rel="icon" href="<?php echo base_url();?>public/img/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="<?php echo base_url(); ?>public/css/bootstrap.min.css" type="text/css" />
    <link href="<?php echo base_url(); ?>public/css/global.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo base_url(); ?>public/js/jquery-ui-1.10.4.custom/css/redmond/jquery-ui-1.10.4.custom.min.css" type="text/css" rel="stylesheet" />
    <link href="<?php echo base_url(); ?>public/css/searchpage.css" rel="stylesheet" type="text/css" />
    <script src="<?php echo base_url(); ?>public/js/jquery-1.10.2.js" type="text/javascript" ></script>
    <script src="<?php echo base_url(); ?>public/js/raty-2.5.2/lib/jquery.raty.js" type="text/javascript" ></script>
    <script src="<?php echo base_url(); ?>/public/js/bootstrap.min.js" type="text/javascript" ></script>
    <script>
        $(function(){
            $(".stars").each(function(){
            $(this).raty({
                score: function(){
                    return $(this).attr('star-score');
                },
                readOnly:true,
                starOn:"<?php echo base_url()?>public/js/raty-2.5.2/lib/img/star-on.png",
                starOff:"<?php echo base_url()?>public/js/raty-2.5.2/lib/img/star-off.png"
            });
        });
    });
    </script>
</head>

<body>
<div class="container">
<?php $this->load->view("header");?>)
    <div class="clear"></div>

    <div class="sortContainer">
        <div class="searchMessage">
                Total Result: <?php echo count($trades); ?>
        </div>
        <div class="sortDropDown">
                <span>Sort by:</span>
                <select>
                    <option name="best-match">best match</option>
                    <option name="best-reputation">best reputation</option>
                </select>
        </div>
    </div>
    <div class="clear"></div>
    <div class="results">
        <?php if(isset($trades)){
            foreach($trades as $trade){
         ?>
        <section class="result">
            <div class="expireDate">Expires: <?php echo $trade['expireDate'] ?></div>
                <ul class="list-unstyled">
                    <li class="imageCls">
                        <ul class="list-unstyled">
                            <li>
                        <img src="<?php echo base_url()?>public/img/userplaceholder.png" />
                            </li>
                            <li>
                                <a class="contact_btn center-block btn btn-primary btn-xs" href="<?php echo base_url()?>index.php/contact?recipient=<?php echo $trade['uid']?>" >Contact Me</a>
                            </li>
                        </ul>
                    </li>
                    <li class="exchangeInfo">I want to learn <?php echo $trade['toLearnName'] ?> , and I can teach <?php echo $trade['toTeachName']; ?> in return</li>
                    
                    <li class="exchangeInfo"><?php echo $trade['firstName'] .' '.$trade['lastName']?> &bull; <?php echo $trade['want']?> </li>
               
                    <li class="exchangeInfo"><?php echo $trade['tradeDesc']?></li>
                    
                </ul>
            <div class="stars" star-score="2"></div>
            
        </section>
        <?php
            
            }
        
            }
        ?>
              
    </div>
</div>
</body>
</html>
